package com.financial.service.heemoney.convertor;

import com.financial.service.heemoney.dto.HeemoneyConfigDTO;
import com.financial.service.heemoney.dto.businsess.HeemoneyPayBusinessDTO;
import com.financial.service.heemoney.dto.commmon.HeemoneyPayCommonDTO;
import com.financial.service.heemoney.dto.inparameter.HeemoneyPayInParamDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;


/**
 * @Author: wenguoqiang
 * @Email wguoqiango@163.com
 * @Date: 2019/12/4 0004 上午 11:45
 * @Des
 */
@Mapper
public interface HeemoneyPayConvert {

    HeemoneyPayConvert MAPPER = Mappers.getMapper(HeemoneyPayConvert.class);

    @Mapping(target = "method", source = "heemoneyConfigDTO.heemoneyPay.method")
    HeemoneyPayCommonDTO configDTOConvertCommonDTO(HeemoneyConfigDTO heemoneyConfigDTO,HeemoneyPayInParamDTO heemoneyPayInParamDTO);


    @Mapping(target = "notify_url", source = "heemoneyConfigDTO.heemoneyPay.notify_url")
    @Mapping(target = "return_url", source = "heemoneyConfigDTO.heemoneyPay.return_url")
    HeemoneyPayBusinessDTO configDTOConvertBusinessDTO(HeemoneyConfigDTO heemoneyConfigDTO, HeemoneyPayInParamDTO heemoneyPayInParamDTO);
}
